package com.xqledu.admin.utils;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xqledu.admin.entry.request.PageRequest;
import lombok.Data;

import java.util.List;

/**
 * @description: 封装一下pageHelper方法
 * @author: 向其林
 * @date: 2023/5/14 0014 15:11
 * @version: 1.0
 **/
public class PageUtils{
    public static void startPage(PageRequest pageRequest){
        PageHelper.startPage(pageRequest.getPageNum(),pageRequest.getPageSize());
    }

    public static <T> PageInfo<T> getPage(List<T> list) {
        return new PageInfo<T>(list);
    }
}
